﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using Northwinddemo.DAL;
using Northwinddemo.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace Northwinddemo.DAL.FactoryClasses
{
	/// <summary>Generates IEntityFields2 instances for different kind of Entities.</summary>
	public partial class EntityFieldsFactory
	{
		/// <summary>Private CTor, no instantiation possible.</summary>
		private EntityFieldsFactory()
		{
		}

		/// <summary>General factory entrance method which will return an EntityFields object with the format generated by the factory specified</summary>
		/// <param name="relatedEntityType">The type of entity the fields are for</param>
		/// <returns>The IEntityFields2 instance requested</returns>
		public static IEntityFields2 CreateEntityFieldsObject(Northwinddemo.DAL.EntityType relatedEntityType)
		{
			IEntityFields2 fieldsToReturn=null;
			IInheritanceInfoProvider inheritanceProvider = InheritanceInfoProviderSingleton.GetInstance();
			IFieldInfoProvider fieldProvider = FieldInfoProviderSingleton.GetInstance();
			switch(relatedEntityType)
			{
				case Northwinddemo.DAL.EntityType.AlphabeticalListOfProductsEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "AlphabeticalListOfProductsEntity");
					break;
				case Northwinddemo.DAL.EntityType.CategoriesEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "CategoriesEntity");
					break;
				case Northwinddemo.DAL.EntityType.CategorySalesFor1997Entity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "CategorySalesFor1997Entity");
					break;
				case Northwinddemo.DAL.EntityType.CurrentProductListEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "CurrentProductListEntity");
					break;
				case Northwinddemo.DAL.EntityType.CustomerAndSuppliersByCityEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "CustomerAndSuppliersByCityEntity");
					break;
				case Northwinddemo.DAL.EntityType.CustomerCustomerDemoEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "CustomerCustomerDemoEntity");
					break;
				case Northwinddemo.DAL.EntityType.CustomerDemographicsEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "CustomerDemographicsEntity");
					break;
				case Northwinddemo.DAL.EntityType.CustomersEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "CustomersEntity");
					break;
				case Northwinddemo.DAL.EntityType.EmployeesEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "EmployeesEntity");
					break;
				case Northwinddemo.DAL.EntityType.EmployeeTerritoriesEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "EmployeeTerritoriesEntity");
					break;
				case Northwinddemo.DAL.EntityType.InvoicesEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "InvoicesEntity");
					break;
				case Northwinddemo.DAL.EntityType.OrderDetailsEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "OrderDetailsEntity");
					break;
				case Northwinddemo.DAL.EntityType.OrderDetailsExtendedEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "OrderDetailsExtendedEntity");
					break;
				case Northwinddemo.DAL.EntityType.OrdersEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "OrdersEntity");
					break;
				case Northwinddemo.DAL.EntityType.OrdersQryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "OrdersQryEntity");
					break;
				case Northwinddemo.DAL.EntityType.OrderSubtotalsEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "OrderSubtotalsEntity");
					break;
				case Northwinddemo.DAL.EntityType.ProductsEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "ProductsEntity");
					break;
				case Northwinddemo.DAL.EntityType.ProductsAboveAveragePriceEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "ProductsAboveAveragePriceEntity");
					break;
				case Northwinddemo.DAL.EntityType.ProductSalesFor1997Entity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "ProductSalesFor1997Entity");
					break;
				case Northwinddemo.DAL.EntityType.ProductsByCategoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "ProductsByCategoryEntity");
					break;
				case Northwinddemo.DAL.EntityType.QuarterlyOrdersEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "QuarterlyOrdersEntity");
					break;
				case Northwinddemo.DAL.EntityType.RegionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "RegionEntity");
					break;
				case Northwinddemo.DAL.EntityType.SalesByCategoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "SalesByCategoryEntity");
					break;
				case Northwinddemo.DAL.EntityType.SalesTotalsByAmountEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "SalesTotalsByAmountEntity");
					break;
				case Northwinddemo.DAL.EntityType.ShippersEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "ShippersEntity");
					break;
				case Northwinddemo.DAL.EntityType.SummaryOfSalesByQuarterEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "SummaryOfSalesByQuarterEntity");
					break;
				case Northwinddemo.DAL.EntityType.SummaryOfSalesByYearEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "SummaryOfSalesByYearEntity");
					break;
				case Northwinddemo.DAL.EntityType.SuppliersEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "SuppliersEntity");
					break;
				case Northwinddemo.DAL.EntityType.TerritoriesEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "TerritoriesEntity");
					break;
			}
			return fieldsToReturn;
		}
		
		/// <summary>General method which will return an array of IEntityFieldCore objects, used by the InheritanceInfoProvider. Only the fields defined in the entity are returned, no inherited fields.</summary>
		/// <param name="entityName">the name of the entity to get the fields for. Example: "CustomerEntity"</param>
		/// <returns>array of IEntityFieldCore fields, defined in the entity with the name specified</returns>
		internal static IEntityFieldCore[] CreateFields(string entityName)
		{
			IFieldInfoProvider fieldProvider = FieldInfoProviderSingleton.GetInstance();
			return fieldProvider.GetEntityFieldsArray(entityName);
		}
		



		#region Included Code

		#endregion
	}
}
